<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>产品管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {			
			$("#contentTable tbody tr").click(function(){
				$("#contentTable tbody tr").removeClass("select_active");
				$(this).addClass("select_active");
			});
			$("#contentTable tbody tr:first-child").click();
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchSubForm").submit();
        	return false;
        }
	</script>
</head>
<body>
<div class="icon-buttons">
	<a href="${ctx}/expert/productCategory/" data-icon="back" data-iconpos="notext" data-role="button" data-inline="true">返回</a>
</div>
	<form:form id="searchSubForm"  action="${ctx}/expert/product/" method="post" class="form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="category_id" name="category_id" type="hidden" value="${parent.id}"/>
		<label>（当前选中 产品分类：${parent.name}）</label>&nbsp;&nbsp;
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" data-role="table" class="ui-responsive table-stroke">
		<thead><tr><th>产品编码</th><th>产品名称</th><th>产品规格</th><th>零售价</th><th>当前状态</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="product">
			<tr id='${product.id}'>
				<td>${product.code}</td>
				<td>${product.name}</td>
				<td>${product.spec}</td>
				<td>${product.retail_price}</td>
				<td>${product.status == 0 ? '可用':'不可用'}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
